//
//  File.swift
//  Mediaplayer
//
//  Created by bin hu on 2025/7/8.
//

import Foundation
import UIKit
import SwiftTheme

extension UITextField{
    func leftViewWithImage(image:ThemeImagePicker, size:CGSize){
        let containerView = UIView(frame: CGRect(x: 0, y: 0, width: size.width+20, height: self.frame.height))
        let y  = (self.frame.height - size.height)/2
        let imgV = UIImageView(frame: CGRect(x: 10, y: y, width: size.width, height: size.height))
        containerView.addSubview(imgV)
        self.leftViewMode = .always
        imgV.contentMode = .scaleAspectFit
    
        imgV.theme_image = image
        self.leftView = containerView
    }
}
